package response;

import javax.jdo.annotations.*;
import com.google.appengine.api.datastore.Key;
import article.*;

@PersistenceCapable
public class Response {
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key reId;
	
	@Persistent
	private Article artId;
	
	@Persistent
	private String reCont;
	
	@Persistent
	private String reDate;
	
	@Persistent
	private String reMember;
	
	@Persistent
	private int reGood;
	
	@Persistent
	private int reBad;
	
	public Response(Article article,String cont,String pub_time,String responser){
		this.artId = article;
		this.reCont = cont;
		this.reDate = pub_time;
		this.reMember = responser;
		this.reGood = 0;
		this.reBad = 0;
	}
	
	public Response(){
		this.reCont = "NA";
		this.reDate = "NA";
		this.reGood = 0;
		this.reBad = 0;
	}
	
	public Long getId(){
		return reId.getId();
	}
	
	public Article getArticle(){
		return artId;
	}
	
	public String getCont(){
		return reCont;
	}
	
	public String getDate(){
		return reDate;
	}
	
	public String getMember(){
		return reMember;
	}
	
	public int getGood(){
		return reGood;
	}
	
	public int getBad(){
		return reBad;
	}
	
	public void setCont(String cont){
		this.reCont = cont;
	}
	
	public void setGood(){
		this.reGood++;
	}
	
	public void setBad(){
		this.reBad++;
	}
}
